-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(cdk/overlay): enhance popover insertion control with new inputs #32362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+77
−15
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crisbeto
reviewed
Nov 17, 2025
src/cdk/overlay/position/flexible-connected-position-strategy.ts
Outdated
Show resolved
Hide resolved
Contributor
Author
|
AFTER: |
crisbeto
reviewed
Nov 17, 2025
crisbeto
reviewed
Nov 17, 2025
src/cdk/overlay/position/flexible-connected-position-strategy.ts
Outdated
Show resolved
Hide resolved
src/cdk/overlay/position/flexible-connected-position-strategy.ts
Outdated
Show resolved
Hide resolved
This commit introduces two new inputs to the CDK overlay, providing more granular control over how popovers are inserted into the DOM: - : Allows specifying a custom element to be used as the host for the popover. The popover will be inserted after this element in the DOM. - : A boolean that, when true, attaches the popover as a child of the popover host, rather than as a sibling.
This commit refactors the popover insertion logic in the CDK overlay by removing and in favor of a more flexible API. This change simplifies the API and provides more granular control over where popovers are inserted into the DOM.
crisbeto
approved these changes
Nov 17, 2025
| disposeOnNavigation?: boolean; | ||
| usePopover?: FlexibleOverlayPopoverLocation | null; | ||
| customPopoverHostElement?: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin | null; | ||
| attachPopoverAsChild?: boolean; |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop these two?
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks!
Contributor
Author
tjshiu
added a commit
that referenced
this pull request
Nov 17, 2025
…uts (#32362) * refactor(cdk/overlay): enhance popover insertion control with new inputs This commit introduces two new inputs to the CDK overlay, providing more granular control over how popovers are inserted into the DOM: - : Allows specifying a custom element to be used as the host for the popover. The popover will be inserted after this element in the DOM. - : A boolean that, when true, attaches the popover as a child of the popover host, rather than as a sibling. * refactor(cdk/overlay): simplify popover insertion logic This commit refactors the popover insertion logic in the CDK overlay by removing and in favor of a more flexible API. This change simplifies the API and provides more granular control over where popovers are inserted into the DOM. * refactor(cdk/overlay): add overlay changes * refactor(cdk/overlay): streamline popover insertion point logic * fix(cdk/overlay): update the insertionpoint type (cherry picked from commit a3b985f)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
action: merge
The PR is ready for merge by the caretaker
area: cdk/overlay
target: rc
This PR is targeted for the next release-candidate
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces two new inputs to the CDK overlay, providing more granular control over how popovers are inserted into the DOM:
cdkCustomPopoverInsertionElement: Allows specifying a custom element to be used as the host forthe popover. The popover will be inserted after this element in the DOM.
This is necessary for cases where we need to move the popover element needs to be in an element that is not the origin:
E.g.: Here the ngMenu needs to have the popover as a child, but we still want the great positioning and styles by having the origin on the fileItem menu item.
cdkAttachPopoverAsChild: A boolean that, when true, attaches the popover as a child of the popovehost, rather than as a sibling.
This allows us to avoid adding a child element on
ngMenuBEFORE:
AFTER: